package br.urca.model;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Embeddable;

@Embeddable
public class CodigoSetor implements Serializable {
	private static final long serialVersionUID = 1L;

	@Column(name = "COD_INSTITUICAO")
	private short codigoInstituicao;
	
	@Column(name = "COD_SETOR")
	private short codigoSetor;

	public CodigoSetor() {
	}

	public CodigoSetor(short codigoInstituicao, short codigoSetor) {
		this.codigoInstituicao = codigoInstituicao;
		this.codigoSetor = codigoSetor;
	}

	public short getCodigoInstituicao() {
		return codigoInstituicao;
	}

	public void setCodigoInstituicao(short codigoInstituicao) {
		this.codigoInstituicao = codigoInstituicao;
	}

	public short getCodigoSetor() {
		return codigoSetor;
	}

	public void setCodigoSetor(short codigoSetor) {
		this.codigoSetor = codigoSetor;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + codigoInstituicao;
		result = prime * result + codigoSetor;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		CodigoSetor other = (CodigoSetor) obj;
		if (codigoInstituicao != other.codigoInstituicao)
			return false;
		if (codigoSetor != other.codigoSetor)
			return false;
		return true;
	}

	
}
